package com.simtop.dao;

import com.simtop.pojo.DownOperate;
import com.simtop.pojo.ExperimentInfo;
import com.simtop.pojo.Operate;
import com.simtop.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserDao {

    int checkLoginName(String loginName);

    int checkEmail(String email);

    int insert(User user);

    User checkLoginNameOrEmail(@Param("loginName") String loginName, @Param("email") String email);

    int updatePasswordByEmail(User user);

    List<User> selectAll();

    int insertBackUser(User user);

    int deleteByUserId(Integer id);

    int updateBackendUser(User user);

    List<User> selectByParams(User user);

    int selectUserCounts();

    User findById(Integer id);

    User findByLoginName(String loginName);

    int inserIlabUser(User user);

    List<ExperimentInfo> getExperimentModules();

    List<User> getUsers();

    void updateMD5Password(User user);

    void insertOperate(Operate operate);

    User checkLogin(@Param("email") String email);


    List<Operate> getOperateInfo();

    List<DownOperate> downLoadOperateInfo();

    /**
     * 修改用户表中习题成绩
     * @param id
     * @param exercises
     * @return
     */
    boolean updateExercises(@Param("id") Integer id,@Param("exercises") Integer exercises);
}
